1. Field of the Invention
The present invention relates to an apparatus, a program and a method for, at the time of expanding an image by a block based on compressed image data compressed by JPEG (Joint Photographic Experts Group), MPEG (Moving Picture Experts Group) or the like, performing a filtering process to the expanded image, and in particular, to an image processing apparatus, an image processing program and an image processing method suitable for simplifying and accelerating the filtering process at the time of decoding the image and implementing an effective filter effect.
2. Description of the Related Art
The JPEG method as a compression technology for a still picture and the MPEG method as a compression technology for a motion picture are widely known. These image compression methods handle a block of 8 pixels×8 pixels as a unit of processing to perform a DCT (Discrete Cosine Transform) process. The DCT process is a process of decomposing an original image into spatial frequency components, and it can compress the image by reducing spatially redundant information.
Incidentally, in case of adopting the JPEG method or the MPEG method, the following two types of noise are generated, which becomes a cause of deteriorating image quality. To be more specific, as the JPEG method and the MPEG method handle the block of 8 pixels×8 pixels as a unit of processing, a boundary of the block may appear as the noise depending on the image. This occurs because the DCT process is the process of eliminating an equivalent to a direct current component of the spatial frequency components of the image, and this process is performed block by block so that an average of luminance of each block becomes different. This noise on the boundary portion is called block noise.
In addition, in the case of the DCT process by the JPEG method and the MPEG method, a higher harmonic component of the spatial frequency components of the image is eliminated as the redundant information so that there appears the noise in a portion of significant difference in luminance from the surroundings. For instance, if the DCT process is performed in the case where there are significant variations in luminance in the block such as a character existing in the backdrop of a natural image, the higher harmonic component is eliminated from data constituting the original boundary portion and blurry noise appears around the boundary. This noise is called mosquito noise.
A technology for reducing the block noise and the mosquito noise is described in Japanese Patent Laid-Open No. 3-46482. As for the technology described therein (hereafter, referred to as a first past example), a filtering process is performed in the case where a signal level difference between boundary pixels located sandwiching the boundary between mutually adjacent blocks is larger than a first threshold, and of the boundary pixel and the pixels on a string in each of the blocks, the signal level differences from the pixels adjacent to that boundary pixel in the same block are smaller than a second threshold respectively.
At this time, in FIG. 14, the signal levels for pixel placements X0 and X′0 are corrected based on difference values d0, d1 and d2 of the signal levels S1, S0, S′0 and S′1 for the pixel placements X1 and X0 and the pixel placements X′0 and X′1 located on both sides of the block boundary. To be more specific, the new signal levels S0-new and S′0-new are as follows.S0-new=(S1+2·S0+S′0)/4S′0-new=(S0+2·S′0+S′1)/4
In addition, as another method of reducing the block noise and the mosquito noise, a VM (Verification Model) for MPEG 4 and the technology described in Japanese Patent Laid-Open No. 11-98505 (hereafter, referred to as a second past example) are also known. In the second past example, it is determined whether the vertical and horizontal block boundaries shown in FIG. 15 are in a default mode or a DC offset mode and processed respectively.
In this case, pixel sets S0, S1 and S2 are defined with block boundaries B1 and B2 as base points, and a deblocking mode is selectively determined as the default mode or the DC offset mode from a mode determination value based on an extent of a block distortion phenomenon. And if it is determined as the default mode, frequency information on the block boundary surroundings for each pixel is obtained by using a 4-point DCT kernel. If it is determined as the DC offset mode in a mode determination stage, it is determined whether or not execution of the DC offset mode is necessary, and if necessary, the block distortion phenomenon is eliminated.
As for the first past example, however, it only corrects the boundary pixels so that there is a drawback of not being sufficient as the process of eliminating the block distortion. In addition, as for the VM and the second past example, processing is complicated and the computation load is excessive.
In addition, in case of implementing these technologies by hardware, the processing is comparatively complicated, and so there is a problem that it is difficult to render a circuit scale smaller. From the viewpoint of rendering it smaller, it is desirable to simplify the process as much as possible even if the image quality is sacrificed to some extent. In addition, it is desirable, as there is a certain limit to a mountable memory capacity, to render the memory capacity to be occupied for an operation in the filtering process as a possible minimum.